package com.ship.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ship.enume.UserType;
/**
 * 用户
 * @author wqf
 * @version  Nov 24, 2011 9:49:12 AM
 */
@Entity
@org.hibernate.annotations.Entity(
		selectBeforeUpdate = true, 
		dynamicInsert = true, 
		dynamicUpdate = true
)
@Table(name="ship_user")
public class User implements Serializable {
	
	private static final long serialVersionUID = 4298448765715271022L;

	@Id
	@GeneratedValue
	private Long id;
	
	/**
	 * 账号
	 */
	@Column(length=20)
	private String sign;
	
	/**
	 * 密码
	 */
	@Column(length=20)
	private String pass;
	
	/**
	 * 用户名称
	 */
	@Column(length=20)
	private String name;
	
	/**
	 * 性别
	 */
	@Column
	private Boolean sex;
	
	/**
	 * 联系电话
	 */
	@Column(length=30)
	private String telphone;
	
	/**
	 * 权限
	 * 0 超级管理员
	 * 1 可修改
	 * 2 只查看
	 */
	@Column
	@Enumerated(EnumType.STRING)
	private UserType userType=UserType.select;
	
	/**
	 * 状态
	 */
	@Column
	private Boolean status;
	
	/**
	 * 备注
	 */
	@Column(length=200)
	private String remark;
	
	@ManyToOne
	@JoinColumn(name="dpId",referencedColumnName="id")
	private Dept dept=new Dept();
		

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getSex() {
		return sex;
	}

	public void setSex(Boolean sex) {
		this.sex = sex;
	}

	public UserType getUserType() {
		return userType;
	}

	public void setUserType(UserType userType) {
		this.userType = userType;
	}

	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Dept getDept() {
		return dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

	public String getTelphone() {
		return telphone;
	}

	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}
}
